/**
 * 
 */
package com.jw.server.model;

import javax.persistence.Entity;

import cn.ydx.protobuf.OTIpcDef;

/**
 * @author Jason Biao
 *
 *         网约车乘客基本信息接口
 */
@Entity
public class BaseInfoPassenger extends BaseEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = -7918785313331045958L;

	private String registerDate;

	private String passengerPhone;

	private String passengerName;

	private String passengerGender;

	private int state;

	public String getRegisterDate() {
		return registerDate;
	}

	public void setRegisterDate(String registerDate) {
		this.registerDate = registerDate;
	}

	public String getPassengerName() {
		return passengerName;
	}

	public void setPassengerName(String passengerName) {
		this.passengerName = passengerName;
	}

	public String getPassengerGender() {
		return passengerGender;
	}

	public void setPassengerGender(String passengerGender) {
		this.passengerGender = passengerGender;
	}

	public String getPassengerPhone() {
		return passengerPhone;
	}

	public void setPassengerPhone(String passengerPhone) {
		this.passengerPhone = passengerPhone;
	}

	public int getState() {
		return state;
	}

	public void setState(int state) {
		this.state = state;
	}

	public static OTIpcDef.BaseInfoPassenger convert(BaseInfoPassenger data) {
		OTIpcDef.BaseInfoPassenger item = OTIpcDef.BaseInfoPassenger
				.newBuilder().setCompanyId(data.getCompanyId())
				.setPassengerPhone(data.getPassengerPhone())
				.setState(data.getState()).setFlag(data.getFlag())
				.setUpdateTime(Long.valueOf(data.getUpdateTime()))
				.setPassengerGender(data.getPassengerGender())
				.setRegisterDate(Long.valueOf(data.getRegisterDate()))
				.setPassengerName(data.getPassengerName()).build();
		return item;
	}

	public static BaseInfoPassenger convertPojo(OTIpcDef.BaseInfoPassenger data) {
		BaseInfoPassenger bip = new BaseInfoPassenger();
		bip.setCompanyId(data.getCompanyId());
		bip.setFlag(data.getFlag());
		bip.setPassengerPhone(data.getPassengerPhone());
		bip.setState(data.getState());
		bip.setUpdateTime(data.getUpdateTime());
		bip.setRegisterDate(data.getRegisterDate() + "");
		bip.setPassengerGender(data.getPassengerGender());
		bip.setPassengerName(data.getPassengerName());
		return bip;
	}
}
